program MyPi;

{$APPTYPE CONSOLE}

uses
  SysUtils;

var
  x, y:real;
  i, N, No:integer;
  fout: textFile;
begin
  randomize;
  assignFile(fout,'output.txt');
  rewrite(fout);
  N:=0;
  No:=0;
  for i:= 1 to 100000000 do
  begin
    x:=2*random;
    y:=2*random;
    if ((x-1)*(x-1)+(y-1)*(y-1)<=1) then
      No:=No+1;
    N:=N+1;
    if (N mod 100000=0) then
      writeln(fout, pi-4*No/N:0:16);
  end;
  close(fout);
end.
 